class_name SkillLibC
extends Node
const component_name := "SkillLibC"

var _notify: Notify  #set from mutil
var _id: int  #entity id

var map := {}
var cur := {"action": 0, "skill": 0} setget _set_cur


func add(skill: SkillCmdC.Skill):
	map[skill.id] = skill
	_set_cur({"action": 1, "skill": skill})


func remove(id: int):
	var skill = map.get(id)
	if not skill:
		return
	var _r = map.erase(id)
	_set_cur({"action": 0, "skill": skill})


func _set_cur(val):
	cur = val
	if _notify:
		_notify.modify_event(_id, "cur")
